<!DOCTYPE html>
<html lang="en" xmlns="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
    <meta charset="UTF-8">
    <title>Title</title>xzc
</head>
<body>

<!--  登陆成功会显示名字 -->
<security:authorize access="isAuthenticated()">
    <h3>登录成功！${username}</h3>
</security:authorize>　　

<!--  MENBER角色就会显示 security:authorize标签里的内容-->
<security:authorize access="hasRole('ROLE_ADMIN')">
    <p>你是MENBER</p>
</security:authorize>


<security:authorize access="hasRole('ROLE_USER')">
    <p>你是MENBER</p>
</security:authorize>

</body>
</html>